# auto load
extends Node


var _pause_time: int
var _pause_duration: int



func _ready() -> void:
    process_mode = Node.PROCESS_MODE_ALWAYS


func pause(value: bool) -> void:
    get_tree().paused = value
    if value:
        _pause_time = Time.get_ticks_msec()
    else:
        _pause_duration += Time.get_ticks_msec() - _pause_time


func get_playing_ticks_msec() -> int:
    return Time.get_ticks_msec() - _pause_duration


